package com.ycd.gis.service.impl;

import java.util.List;
import com.ycd.common.utils.DateUtils;
import com.ycd.gis.service.IGisMarkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ycd.gis.mapper.GisMarkerMapper;
import com.ycd.gis.domain.GisMarker;
import com.ycd.common.core.text.Convert;

/**
 * 标记类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-02
 */
@Service
public class GisMarkerServiceImpl implements IGisMarkerService
{
    @Autowired
    private GisMarkerMapper gisMarkerMapper;

    /**
     * 查询标记类别
     * 
     * @param id 标记类别主键
     * @return 标记类别
     */
    @Override
    public GisMarker selectGisMarkerById(Long id)
    {
        return gisMarkerMapper.selectGisMarkerById(id);
    }

    /**
     * 查询标记类别列表
     * 
     * @param gisMarker 标记类别
     * @return 标记类别
     */
    @Override
    public List<GisMarker> selectGisMarkerList(GisMarker gisMarker)
    {
        return gisMarkerMapper.selectGisMarkerList(gisMarker);
    }

    /**
     * 新增标记类别
     * 
     * @param gisMarker 标记类别
     * @return 结果
     */
    @Override
    public int insertGisMarker(GisMarker gisMarker)
    {
        //设置创建时间
        gisMarker.setCreateTime(DateUtils.getNowDate());
        //默认标记记录数为0
        gisMarker.setRecordNumber(0);
        return gisMarkerMapper.insertGisMarker(gisMarker);
    }

    /**
     * 修改标记类别
     * 
     * @param gisMarker 标记类别
     * @return 结果
     */
    @Override
    public int updateGisMarker(GisMarker gisMarker)
    {
        gisMarker.setUpdateTime(DateUtils.getNowDate());
        return gisMarkerMapper.updateGisMarker(gisMarker);
    }

    /**
     * 批量删除标记类别
     * 
     * @param ids 需要删除的标记类别主键
     * @return 结果
     */
    @Override
    public int deleteGisMarkerByIds(String ids)
    {
        return gisMarkerMapper.deleteGisMarkerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除标记类别信息
     * 
     * @param id 标记类别主键
     * @return 结果
     */
    @Override
    public int deleteGisMarkerById(Long id)
    {
        return gisMarkerMapper.deleteGisMarkerById(id);
    }
}
